
#include "stdafx.h"
#include "WicBitmapCodecInfo.h"

//==============================================================================
// CWicBitmapCodecInfo
//==============================================================================

CWicBitmapCodecInfo::CWicBitmapCodecInfo()
{
    m_pIWICBitmapCodecInfo = NULL;
}

CWicBitmapCodecInfo::~CWicBitmapCodecInfo()
{
    if(m_pIWICBitmapCodecInfo)
    {
        m_pIWICBitmapCodecInfo->Release();
    }
    m_pIWICBitmapCodecInfo = NULL;
}

CWicBitmapCodecInfo::CWicBitmapCodecInfo(CWicBitmapCodecInfo const & objBitmapCodecInfo)
{
    m_pIWICBitmapCodecInfo = objBitmapCodecInfo.m_pIWICBitmapCodecInfo;
    m_pIWICBitmapCodecInfo->AddRef();
}

CWicBitmapCodecInfo& CWicBitmapCodecInfo::operator=(CWicBitmapCodecInfo const & objBitmapCodecInfo)
{
    if(m_pIWICBitmapCodecInfo)
    {
        m_pIWICBitmapCodecInfo->Release();
    }
    m_pIWICBitmapCodecInfo = objBitmapCodecInfo.m_pIWICBitmapCodecInfo;
    m_pIWICBitmapCodecInfo->AddRef();
    return *this;
}

//==============================================================================
// IWICBitmapCodecInfo
//==============================================================================
HRESULT CWicBitmapCodecInfo::GetContainerFormat(/* [out] */ GUID *pguidContainerFormat)
{
    g_hrLast = m_pIWICBitmapCodecInfo->GetContainerFormat(pguidContainerFormat);
    return g_hrLast;
}

HRESULT CWicBitmapCodecInfo::GetPixelFormats(
                        /* [in] */ UINT cFormats,
                        /* [size_is][unique][out][in] */ GUID *pguidPixelFormats,
                        /* [out] */ UINT *pcActual)
{
    g_hrLast = m_pIWICBitmapCodecInfo->GetPixelFormats(cFormats, pguidPixelFormats, pcActual); 
    return g_hrLast;
}

HRESULT CWicBitmapCodecInfo::GetColorManagementVersion(
                                  /* [in] */ UINT cchColorManagementVersion,
                                  /* [size_is][unique][out][in] */ WCHAR *wzColorManagementVersion,
                                  /* [out] */ UINT *pcchActual)
{
    g_hrLast = m_pIWICBitmapCodecInfo->GetColorManagementVersion(cchColorManagementVersion, wzColorManagementVersion, pcchActual);
    return g_hrLast;
}

HRESULT CWicBitmapCodecInfo::GetDeviceManufacturer(
                              /* [in] */ UINT cchDeviceManufacturer,
                              /* [size_is][unique][out][in] */ WCHAR *wzDeviceManufacturer,
                              /* [out] */ UINT *pcchActual)
{
    g_hrLast = m_pIWICBitmapCodecInfo->GetDeviceManufacturer(cchDeviceManufacturer, wzDeviceManufacturer, pcchActual);
    return g_hrLast;
}

HRESULT CWicBitmapCodecInfo::GetDeviceModels(
                        /* [in] */ UINT cchDeviceModels,
                        /* [size_is][unique][out][in] */ WCHAR *wzDeviceModels,
                        /* [out] */ UINT *pcchActual)
{
    g_hrLast = m_pIWICBitmapCodecInfo->GetDeviceModels(cchDeviceModels, wzDeviceModels, pcchActual);
    return g_hrLast;
}

HRESULT CWicBitmapCodecInfo::GetMimeTypes(
                     /* [in] */ UINT cchMimeTypes,
                     /* [size_is][unique][out][in] */ WCHAR *wzMimeTypes,
                     /* [out] */ UINT *pcchActual)
{
    g_hrLast = m_pIWICBitmapCodecInfo->GetMimeTypes(cchMimeTypes, wzMimeTypes, pcchActual);
    return g_hrLast;
}

HRESULT CWicBitmapCodecInfo::GetFileExtensions(
                          /* [in] */ UINT cchFileExtensions,
                          /* [size_is][unique][out][in] */ WCHAR *wzFileExtensions,
                          /* [out] */ UINT *pcchActual)
{
    g_hrLast = m_pIWICBitmapCodecInfo->GetFileExtensions(cchFileExtensions, wzFileExtensions, pcchActual);
    return g_hrLast;
}

HRESULT CWicBitmapCodecInfo::DoesSupportAnimation(
                             /* [out] */ BOOL *pfSupportAnimation)
{
    g_hrLast = m_pIWICBitmapCodecInfo->DoesSupportAnimation(pfSupportAnimation);
    return g_hrLast;
}

HRESULT CWicBitmapCodecInfo::DoesSupportChromakey(
                             /* [out] */ BOOL *pfSupportChromakey)
{
    g_hrLast = m_pIWICBitmapCodecInfo->DoesSupportChromakey(pfSupportChromakey);
    return g_hrLast;
}

HRESULT CWicBitmapCodecInfo::DoesSupportLossless(
                            /* [out] */ BOOL *pfSupportLossless)
{
    g_hrLast = m_pIWICBitmapCodecInfo->DoesSupportLossless(pfSupportLossless);
    return g_hrLast;
}

HRESULT CWicBitmapCodecInfo::DoesSupportMultiframe(
                              /* [out] */ BOOL *pfSupportMultiframe)
{
    g_hrLast = m_pIWICBitmapCodecInfo->DoesSupportMultiframe(pfSupportMultiframe);
    return g_hrLast;
}

HRESULT CWicBitmapCodecInfo::MatchesMimeType(
                        /* [in] */ LPCWSTR wzMimeType,
                        /* [out] */ BOOL *pfMatches)
{
    g_hrLast = m_pIWICBitmapCodecInfo->MatchesMimeType(wzMimeType, pfMatches);
    return g_hrLast;
}

//==============================================================================
// IWICComponentInfo
//==============================================================================
WICComponentType CWicBitmapCodecInfo::GetComponentType()
{
    WICComponentType type;
    g_hrLast = m_pIWICBitmapCodecInfo->GetComponentType(&type);
    return type;
}

HRESULT CWicBitmapCodecInfo::GetCLSID(/* [out] */ CLSID *pclsid)
{
    g_hrLast = m_pIWICBitmapCodecInfo->GetCLSID(pclsid);
    return g_hrLast;
}

DWORD CWicBitmapCodecInfo::GetSigningStatus()
{
    DWORD dwStatus = 0;
    g_hrLast = m_pIWICBitmapCodecInfo->GetSigningStatus(&dwStatus);
    return dwStatus;
}

UINT CWicBitmapCodecInfo::GetAuthor(UINT cchAuthor, WCHAR *wzAuthor)
{
    UINT uResult = 0;
    g_hrLast = m_pIWICBitmapCodecInfo->GetAuthor(cchAuthor, wzAuthor, &uResult);
    return uResult;
}

HRESULT CWicBitmapCodecInfo::GetVendorGUID(/* [out] */ GUID *pguidVendor)
{
    g_hrLast = m_pIWICBitmapCodecInfo->GetVendorGUID(pguidVendor);
    return g_hrLast;
}

UINT CWicBitmapCodecInfo::GetVersion(UINT cchVersion, WCHAR *wzVersion)
{
    UINT uResult = 0;
    g_hrLast = m_pIWICBitmapCodecInfo->GetVersion(cchVersion, wzVersion, &uResult);
    return uResult;
}

UINT CWicBitmapCodecInfo::GetSpecVersion(UINT cchSpecVersion, WCHAR *wzSpecVersion)
{
    UINT uResult = 0;
    g_hrLast = m_pIWICBitmapCodecInfo->GetSpecVersion(cchSpecVersion, wzSpecVersion, &uResult);
    return uResult;
}

UINT CWicBitmapCodecInfo::GetFriendlyName(UINT cchFriendlyName, WCHAR *wzFriendlyName)
{
    UINT uResult = 0;
    g_hrLast = m_pIWICBitmapCodecInfo->GetFriendlyName(cchFriendlyName, wzFriendlyName, &uResult);
    return uResult;
}

